/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.profesoresparticulares.service.impl;

import java.util.ArrayList;
import org.springframework.stereotype.Service;
import pe.edu.upc.dew.profesoresparticulares.model.Hora;
import pe.edu.upc.dew.profesoresparticulares.service.HoraService;

/**
 *
 * @author Wilder
 */
@Service("horaService")
public class HoraServiceImpl implements HoraService{
  
    private ArrayList<Hora> horas = new ArrayList<Hora>();

    public HoraServiceImpl() {
        horas.add(new Hora(8,"08:00"));
        horas.add(new Hora(9,"09:00"));
        horas.add(new Hora(10,"10:00"));
        horas.add(new Hora(11,"11:00"));
        horas.add(new Hora(12,"12:00"));
        horas.add(new Hora(13,"13:00"));
        horas.add(new Hora(14,"14:00"));
        horas.add(new Hora(15,"15:00"));
        horas.add(new Hora(16,"16:00"));
        horas.add(new Hora(17,"17:00"));
        horas.add(new Hora(18,"18:00"));
        horas.add(new Hora(19,"19:00"));
        horas.add(new Hora(20,"20:00"));
        horas.add(new Hora(21,"21:00"));
        horas.add(new Hora(22,"22:00"));
        horas.add(new Hora(23,"23:00"));
    }

    public ArrayList<Hora> getHoras() {
        return horas;
    }

    public Hora getHora(Integer codHora) {
        for (Hora hora : horas) {
            if(hora.getClave()==codHora){
                return hora;
            }
        }
        return new Hora();
    }

}
